import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LawFirmTagVo, LawFirmTagForm, LawFirmTagQuery } from '@/api/lawfirm/tag/types';

/**
 * 查询律所标签管理列表
 * @param query
 * @returns {*}
 */

export const listLawFirmTag = (query?: LawFirmTagQuery): AxiosPromise<LawFirmTagVo[]> => {
  return request({
    url: '/lawyer/lawFirmTag/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询律所标签管理详细
 * @param id
 */
export const getLawFirmTag = (id: string | number): AxiosPromise<LawFirmTagVo> => {
  return request({
    url: '/lawyer/lawFirmTag/' + id,
    method: 'get'
  });
};

/**
 * 新增律所标签管理
 * @param data
 */
export const addLawFirmTag = (data: LawFirmTagForm) => {
  return request({
    url: '/lawyer/lawFirmTag/saveLawFirmTag',
    method: 'post',
    data: data
  });
};

/**
 * 修改律所标签管理
 * @param data
 */
export const updateLawFirmTag = (data: LawFirmTagForm) => {
  return request({
    url: '/lawyer/lawFirmTag/updateLawFirmTag',
    method: 'post',
    data: data
  });
};

/**
 * 删除律所标签管理
 * @param id
 */
export const delLawFirmTag = (id: string | number | Array<string | number>) => {
  return request({
    url: '/lawyer/lawFirmTag/removeLawFirmTag/' + id,
    method: 'delete'
  });
};
